def isPalindrome(num):
    """

    0. count the number of digits
    1. get high half digits
    2. reverse high half and add rslt to low half
    3. compare palindrome created to original num
    :type num: int
    :rtype: True or False
    """
    if abs(num) < 10:
        return True;
    digits = 0;
    rem = abs(num);
    while rem != 0:
        rem = rem // 10;
        digits += 1;

    halfNum = abs(num) // (10 ** (digits // 2));
    print(digits, 'digits', halfNum);
    rem = halfNum;
    newNum = halfNum;
    if digits % 2 != 0:
        rem = halfNum // 10;
    while rem != 0:
        newNum = newNum * 10 + (rem % 10);
        rem = rem // 10;
    if newNum == abs(num):
        return True;
    else:
        return False;

def isPalindrome2(num):
    """

    Compare reminder and reversed as num parsing
    :type num: int
    :rtype: True or False
    """
    if abs(num) < 10:
        return True;
    digits = 0;
    rem = abs(num);
    newNum = 0;
    while rem != 0:
        newNum = newNum * 10 + (rem % 10);

        if newNum > rem:
            return False;
        elif newNum == rem:
            return True;
        elif newNum == 0: #ends with 0s
            return False;

        rem = rem // 10;

        if newNum > rem:
            return False;
        elif newNum == rem:
            return True;

